var express = require("express");
var bodyParser = require("body-parser");
var shell = require("shelljs");
var app = express();

// app.use(function (req, res, next) {
//   res.set('Access-Control-Allow-Origin', '*');
//   res.set('Access-Control-Allow-Methods', 'POST');
//   res.set('Access-Control-Allow-Headers', 'Content-Type');
//   next();
// })

app.use(express.static(__dirname + "/public"));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(bodyParser.text());

app.get("/test", (req, res)=>{
    console.log(req.query);
    res.send("hello");
});

app.post("/test", (req, res)=>{
    console.log(req.body);
    res.send("hello");
});


app.listen(6000, function() {
    console.log("server listen on: http://localhost:6000");
});